home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 483 / mkrscsrc / objutil.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-04-26  |  1.3 KB  |  68 lines

  1. #include "stdio.h"
  2. #include "gemdefs.h"
  3. #include "obdefs.h"
  4. #include "osbind.h"
  5. #include "mkrsc.h"
  6. #include "globals.h"
  7.  
  8.  
  9.  
  10. draw_inwind(thewin,blank)
  11.     windowptr thewin;
  12.     int    blank;
  13. {
  14.     int    cx, cy, cw, ch;
  15.     OBJECT *inwind;
  16.  
  17.     inwind = thewin->inwindow->objt;
  18.  
  19.     cx = thewin->work.g_x;
  20.     cy = thewin->work.g_y;
  21.     cw = thewin->work.g_w;
  22.     ch = thewin->work.g_h;
  23.     
  24.     if(blank)
  25.         whiterect(thefrontwin);
  26.  
  27.     if(thefrontwin->inwindow->kind[0] == TMENU)
  28.     {
  29.         objc_draw(inwind,1,2,cx,cy,cw,ch);
  30.         if(thefrontwin->inwindow->mbox > 0)     
  31.             objc_draw(inwind,thefrontwin->inwindow->mbox,10,cx,cy,cw,ch);
  32.     }
  33.     else
  34.  
  35.     objc_draw(inwind, 0, 10, cx, cy, cw, ch);
  36. }
  37.  
  38.    /* draw dialog boxes   */
  39. int do_dialog(dialog,start_obj)   /* with form_do   */
  40.     OBJECT    *dialog;
  41.     int        start_obj;
  42. {
  43.     int cx, cy, cw, ch;  /* dialog box dimensions  */
  44.     int button;
  45.  
  46.     form_center(dialog, &cx, &cy, &cw, &ch);
  47.     form_dial(FMD_START, 0, 0, 0, 0, cx, cy, cw, ch);
  48.     objc_draw(dialog, 0, 10, cx, cy, cw, ch);
  49.     button = form_do(dialog, start_obj);
  50.     form_dial(FMD_FINISH, 0, 0, 0, 0, cx, cy, cw, ch);
  51.     return(button);
  52. }
  53.  
  54. /* draw object .. no form_do  only to draw icon palettes    */
  55.  
  56. int draw_obj(obj)
  57. OBJECT *obj;
  58. {
  59.     int    cx, cy, cw, ch;
  60.  
  61.     cx = obj->ob_x;
  62.     cy = obj->ob_y;
  63.     cw = obj->ob_width;
  64.     ch = obj->ob_height;
  65.  
  66.     objc_draw(obj, 1, 10, cx, cy, cw, ch);
  67. }
  68.